package com.module.sysconfig.service.impl;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.module.sysconfig.dao.BdckMapper;
import com.module.sysconfig.entity.Bdck;
import com.module.sysconfig.service.BdckService;
import com.support.cache.annotation.CacheEvict;
import com.support.cache.annotation.Cacheable;
import com.support.cache.annotation.KeyMode;

@Service
public class BdckServiceImpl implements BdckService
{

	private BdckMapper bdckMapper;
	
	@Autowired
	public void setBdckMapper(BdckMapper bdckMapper) 
	{
		this.bdckMapper = bdckMapper;
	}
	
	/**
	 * 新增系统表单仓库数据
	 */

	@CacheEvict(key="ALL_BDCK_RECORD")
	public void saveBdck(Bdck bdck)
	{
		bdckMapper.saveBdck(bdck);
	}

	/**
	 * 更新系统表单仓库数据
	 */
	@CacheEvict(key="ALL_BDCK_RECORD")
	public void updateBdck(Bdck bdck) 
	{
		bdckMapper.updateBdck(bdck);
	}

	/**
	 * 删除系统表单仓库数据
	 */
	@CacheEvict(key="ALL_BDCK_RECORD")
	public void deleteBdck(long id) 
	{
		bdckMapper.deleteBdck(id);
	}

	/**
	 * 根据ID查询系统表单仓库数据
	 * @param id
	 * @return
	 */
	public Bdck queryBdckById(long id)
	{
		return bdckMapper.queryBdckById(id);
	}

	/**
	 * 查询所有系统表单仓库数据
	 */
	@Cacheable(keyMode=KeyMode.KEY_ONLY, key="ALL_BDCK_RECORD")
	public List<Map<String, Object>> queryBdckRecord()
	{
		return bdckMapper.queryBdckRecord();
	}
}
